import re
import os
import sys
import time
import socket


udt_svr_addr = "127.0.0.1"
udt_svr_port = 21828

udt_req_full = "1234567890abcdefghijklmnopqrstuvwxyz"

udt_redo_times = 8192

if __name__ == '__main__':
  i = 0
  while i < udt_redo_times:
    udt_cli_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  
    udt_cli_sock.connect((udt_svr_addr, udt_svr_port))
    time.sleep(1)

    print "> "+udt_req_full
    udt_cli_sock.send(udt_req_full)

    time.sleep(1)
    udt_data_recved = udt_cli_sock.recv(1024)
    print "< " + udt_data_recved
    udt_cli_sock.close()

    print "i==%d times OK" %i
    i = i + 1

  print "< OK"
  
